package com.bilicraft.plugin.kexue.commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

import com.bilicraft.plugin.kexue.ShellUser;

public abstract class BiliCmd {
	public int nofArgs = 0;
	
	/** to execute exactly command function*/
	protected abstract boolean doExec(CommandSender sender, Command cmd, String label, String[] args, ShellUser shellUser);
	
	/** check & execute*/
	public boolean exec(CommandSender sender, Command cmd, String label, String[] args, ShellUser shellUser){
		if(args.length < nofArgs){
			sender.sendMessage("Not enough arguments.");
			return false;
		}
		return doExec(sender, cmd, label, args, shellUser);
	}
}
